<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<% request.setCharacterEncoding("UTF-8"); %>
<%@ page language="java" import="cn.sdcet.project.service.UserInfoService" %>
<%@ page language="java" import="cn.sdcet.project.domain.UserInfo" %>
<!DOCTYPE HTML>
<html>
	<head>
	<meta charset="utf-8">
	<title>我的信息</title>
	<link href="https://fonts.googleapis.com/css?family=Josefin+Slab:400,600,700" rel="stylesheet">
	<link href="https://fonts.googleapis.com/css?family=Sacramento" rel="stylesheet">
	<!-- Animate.css -->
	<link rel="stylesheet" href="css/animate.css">
	<!-- Icomoon Icon Fonts-->
	<link rel="stylesheet" href="css/icomoon.css">
	<!-- Bootstrap  -->
	<link rel="stylesheet" href="css/bootstrap.css">
	<!-- Magnific Popup -->
	<link rel="stylesheet" href="css/magnific-popup.css">

	<!-- Flexslider  -->
	<link rel="stylesheet" href="css/flexslider.css">

	<!-- Theme style  -->
	<link rel="stylesheet" href="css/style.css">

	<!-- Modernizr JS -->
	<script src="js/modernizr-2.6.2.min.js"></script>
    <!-- jQuery -->
	<script src="js/jquery.min.js"></script>
	<!-- jQuery Easing -->
	<script src="js/jquery.easing.1.3.js"></script>
	<!-- Bootstrap -->
	<script src="js/bootstrap.min.js"></script>
	<!-- Waypoints -->
	<script src="js/jquery.waypoints.min.js"></script>
	<!-- Flexslider -->
	<script src="js/jquery.flexslider-min.js"></script>
	<!-- Magnific Popup -->
	<script src="js/jquery.magnific-popup.min.js"></script>
	<script src="js/magnific-popup-options.js"></script>
	<!-- Main -->
	<script src="js/main.js"></script>
	<script type="text/javascript">
		function updinfo(){
			var subval = document.getElementById("updatebtn").value;
			var judge;
			if(subval=="确认修改"){
				document.getElementById("updatebtn").value="修改";
				judge=true;
				subupdateinfo.submit();
			}else{
				document.getElementById("updatebtn").value="确认修改";
				judge=false;
				
			}
			document.getElementById("name").disabled=judge;
			document.getElementById("genderman").disabled=judge;
			document.getElementById("genderwoman").disabled=judge;
			document.getElementById("email").disabled=judge;
			document.getElementById("idcard").disabled=judge;
			
			
		}
	</script>
	

	</head>
	<body>
	
	<%
	UserInfo userinfo=new UserInfo();
	Object objname=session.getAttribute("username");
	if(objname==null){
		response.sendRedirect("../LoginOut/login.jsp?returnUrl="+request.getRequestURI());
	}else{
		String loginid=objname.toString();
		UserInfoService userinfoService=new UserInfoService();
		userinfo=userinfoService.getUserInfo(loginid);	
		
	}
		
	
	%>	
	
	<div class="fh5co-loader"></div>
	
	<div id="page">
	<nav class="fh5co-nav" role="navigation">
		<div class="container-fluid">
			<div class="row">
				<div class="top-menu">
					<div class="container">
						<div class="row">
							<div class="col-sm-7 text-left menu-1">
								<ul>
									<li><a href="../FirstFront/index.jsp">首页</a></li>
									<li><a href="../MapSearch/map.jsp">搜索地图</a></li>
									<li><a href="../ShopCar/shoppingcar.jsp">我的购物车</a></li>
								</ul>
							</div>
							<div class="col-sm-5">
								<ul class="fh5co-social-icons">
									<li><a href="#">注销</a></li>
								</ul>
							</div>
						</div>
					</div>
				</div>
			</div>
			
		</div>
	</nav>

	<div id="fh5co-content" >
		<div class="container" style="margin:auto;">
			<div class="row animate-box" style="margin:auto;">
				<div class="col-md-6 col-md-offset-3 text-center fh5co-heading">
					<h2><span>我的信息</span></h2>
				</div>
			</div>
			<div class="row" style="margin:auto;">
				<div class="col-md-6 col-md-offset-3">
					<div class="fh5co-staff">
						<img src="images/user-2.jpg" alt="Free HTML5 Templates by FreeHTML5.co">
						<h3><a href="#">我的头像</a></h3>
						<div class="" style="margin-top:30px;">
					<form name="subupdateinfo" id="subupdateinfo" action="../UpdUserInfo" method="post">
						<div class="form-group row">
							<div class="col-md-6 field">
								<div class="divtitlename">姓名：</div>
								<span>
									<input type="text" name="name" id="name" disabled="disabled" 
									class="form-control" style="width:600px;"  value="<%=userinfo.getName()%>" >
								</span>
							</div>
						</div>
                        <div class="form-group row">
							<div class="col-md-6 field">
								<div class="divtitlename">性别：</div>
								<div>
                                	<label style="font-weight:normal;">
                                		<input type="radio" name="gender" id="genderman" class="radiogender" value="1" <%
                                		if(userinfo.getGender()==1)
                                		%> checked<%
                                		%>  disabled="disabled">男
                                	</label>
									<label style="font-weight:normal;">
										<input type="radio" name="gender" id="genderwoman" class="radiogender" value="2" <%
                                		if(userinfo.getGender()==2)
                                		%> checked<%
                                		%> 
										 disabled="disabled">女
									</label>
                                </div>
							</div>
						</div>
						<div class="form-group row">
							<div class="col-md-6 field">
								<div class="divtitlename">邮箱：</div>
								<input type="text" name="email" id="email" class="form-control" style="width:600px;" 
								 disabled="disabled"  value="<%=userinfo.getEmail()%>" >
							</div>
						</div>
                        <div class="form-group row">
							<div class="col-md-6 field">
								<div class="divtitlename">身份证号：</div>
								<input type="text" name="idcard" id="idcard" class="form-control" style="width:600px;" 
								disabled="disabled" value="<%=userinfo.getCardid()%>" > 
							</div>
						</div>
						<div class="form-group row">
							<div class="col-md-12 field">
								<input type="button" id="updatebtn" class="btn btn-primary" value="修改" onclick="updinfo()">
							</div>
						</div>
					</form>
				</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	

	<div id="fh5co-instagram">
		<div class="container">
			<div class="row animate-box">
				<div class="col-md-12 col-md-offset-0 text-center fh5co-heading">
					<h2><span>Instagram Posts</span></h2>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="col-md-3 nopadding animate-box">
				<div class="insta" style="background-image: url(images/insta-1.jpg);"></div>
			</div>
			<div class="col-md-3 nopadding animate-box">
				<div class="insta" style="background-image: url(images/insta-2.jpg);"></div>
			</div>
			<div class="col-md-3 nopadding animate-box">
				<div class="insta" style="background-image: url(images/insta-3.jpg);"></div>
			</div>
			<div class="col-md-3 nopadding animate-box">
				<div class="insta" style="background-image: url(images/insta-4.jpg);"></div>
			</div>
		</div>
	</div>

	<footer id="fh5co-footer" role="contentinfo">
		<div class="container">
			<div class="row row-pb-md">
				<div class="col-md-4 fh5co-widget">
					<h4>Paper</h4>
					<p>Facilis ipsum reprehenderit nemo molestias. Aut cum mollitia reprehenderit. Eos cumque dicta adipisci architecto culpa amet.</p>
				</div>
				<div class="col-md-4 col-md-push-1">
					<h4>Links</h4>
					<ul class="fh5co-footer-links">
						<li><a href="#">Return to the Home</a></li>
						<li><a href="#">Return to the Map</a></li>
						<li><a href="#">Click to Register</a></li>
						<li><a href="#">Click to Login</a></li>
					</ul>
				</div>

				<div class="col-md-4 col-md-push-1">
					<h4>Contact Information</h4>
					<ul class="fh5co-footer-links">
						<li>Shandong College <br> Of Electronic Technology</li>
						<li><a href="#">+ 1234 5678 90</a></li>
						<li><a href="#">zfyzc@sdcet.com</a></li>
						<li><a href="#">www.ZFandYZC.com.cn</a></li>
					</ul>
				</div>

			</div>

			<div class="row copyright">
				<div class="col-md-12 text-center">
					<p>
						<small class="block">&copy; 2017 ZhangFang&amp;YinZichen All Rights Reserved</small>
					</p>
					<p>
						<ul class="fh5co-social-icons">
							<li><a href="#"><i class="icon-twitter"></i></a></li>
							<li><a href="#"><i class="icon-facebook"></i></a></li>
							<li><a href="#"><i class="icon-linkedin"></i></a></li>
							<li><a href="#"><i class="icon-dribbble"></i></a></li>
						</ul>
					</p>
				</div>
			</div>

		</div>
	</footer>
	</div>

	<div class="gototop js-top">
		<a href="#" class="js-gotop"><i class="icon-arrow-up"></i></a>
	</div>
	
	

	</body>
</html>

